package com.itools.core.ucenter.controller;


import com.itools.core.ucenter.service.ApplicationInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author XUCHANG
 * @since 2021-07-23
 */
@RestController
@RequestMapping("/res/application")
public class ApplicationInfoController {
    @Autowired
    private ApplicationInfoService applicationInfoService;

    @GetMapping("/query")
    @PreAuthorize("hasAnyAuthority('query')")
    public Authentication query() {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        return authentication;
    }
}

